package com.why.whyoj.judge;

import com.why.whyoj.judge.strategy.DefaultJudgeStrategy;
import com.why.whyoj.judge.strategy.JudgeContext;
import com.why.whyoj.judge.strategy.JudgeStrategy;
import com.why.whyoj.model.dto.questionsubmit.JudgeInfo;
import org.springframework.stereotype.Service;

@Service
public class JudgeManager {
    JudgeInfo doJudge(JudgeContext context) {
        String language = context.getLanguage();
        JudgeStrategy strategy = null;
        if (language.equals("java")) {
            strategy = new DefaultJudgeStrategy();
        }
        return strategy.doJudge(context);
    }
}
